package com.cloud.form.api.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.form.api.entity.FormDataSet;
import com.cloud.form.api.service.FormDataSetService;
import com.cloud.form.common.result.Quokka;

@RestController
@RequestMapping("/form/api/formdataset")
public class FormDataSetController {
	
	@Autowired
	private FormDataSetService formDataSetService;
	
	@RequestMapping("list")
	public Quokka listDataSet(long formId){
		return new Quokka(true, formDataSetService.listDataSet(formId));
	}
	
	@RequestMapping("detail")
	public Quokka detail(long id){
		return new Quokka(true, formDataSetService.showDetail(id));
	}
	
	@RequestMapping("delete")
	public Quokka delete(long id){
		return new Quokka(true, formDataSetService.delete(id));
	}
	
	@RequestMapping("createupdate")
	public Quokka createUpdate(@RequestBody FormDataSet dataSet){
		return new Quokka(true, formDataSetService.createUpdate(dataSet));
	}
	
}
